import {request} from "@/utils/request";
import type {CategoryList, CategoryPreItem} from "@/types/category";
import type {PageResult} from "@/types/PageResult";

/**
 * 获取分类列表
 */
export const getCategoryListApi=()=>{
    return request<CategoryList>({
        method:"GET",
        url:'/AW/classification'
    })
}

/**
 * 获取分类详情页的动物预览数据
 * @param id
 * @param page
 * @param pageSize
 */
export const getCategoryPreListApi=(id:number,page:number,pageSize:number)=>{
    return request<PageResult<CategoryPreItem[]>>({
        method:"GET",
        url:`/page/categoryList?categoryId=`+id+`&page=`+page+`&pageSize=`+pageSize
    })
}